package com.qmds.deviceserver.product.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qmds.common.core.entity.Product;
import com.qmds.deviceserver.product.vo.ProductVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * --- 代码敲烂 月薪过万 ---
 *
 * @author ShiJiaWei
 * @date 2024/9/11
 * @desc:
 */
public interface ProductMapper extends BaseMapper<Product> {

    @Select("SELECT p.*, pt.type_name, d.device_maker, d.status FROM product p, product_type pt, device d " +
            "where p.pid = pt.id and p.did = d.id and p.did = #{did}")
    ProductVO  getProductById(@Param("did") Integer did);
}
